/**********************************************************************************************************************
 *
 * Project:    mGameEngine
 * File:       plane.h
 * Author:     karooolek
 * Created on: Oct 14, 2009
 *
 **********************************************************************************************************************/

#ifndef PLANE_H_
#define PLANE_H_

#include "shape.h"
#include "vector3.h"

namespace mGameEngine
{

/**
 * Infinite plane in three-dimensional space.
 */
class Plane : public Shape
{
private:
    /**
     * Normal.
     */
    Vector3 _normal;

    /**
     * Origin.
     */
    Vector3 _origin;

public:
    /**
     * Create plane with specified normal at origin.
     * @param normal normal.
     * @param origin origin.
     */
    Plane(const Vector3 &normal = Vector3(0.0f, 0.0f, 1.0f),
            const Vector3 &origin = Vector3());

    /**
     * Destroy plane.
     */
    ~Plane();

    /**
     * Get plane normal.
     * @return plane normal.
     */
    const Vector3 &getNormal() const
    {
        return _normal;
    }

    /**
     * Set plane normal.
     * @param normal normal.
     */
    void setNormal(const Vector3 &normal)
    {
        _normal = normal;
    }

    /**
     * Get plane origin.
     * @return plane origin.
     */
    const Vector3 &getOrigin() const
    {
        return _origin;
    }

    /**
     * Set plane origin.
     * @param origin origin.
     */
    void setOrigin(const Vector3 &origin)
    {
        _origin = origin;
    }
};

}

#endif // PLANE_H_
